package com.my.ycv51.ycinit.config;


import com.my.ycv51.ycinit.en.DecoderPriority;

/**
 * The configuration of the decoder decode.
 *
 * @Author MRH
 */
public class DecodeConfig {


    /**
     * The character set of the decoder.
     */
    private String characterSet;


    /**
     * The priority of the decoder.
     */
    private DecoderPriority priority;

    public DecodeConfig() {
    }

    public DecodeConfig(String characterSet, DecoderPriority priority) {
        this.characterSet = characterSet;
        this.priority = priority;
    }

    public String getCharacterSet() {
        return characterSet;
    }


    public DecoderPriority getPriority() {
        return priority;
    }


    @Override
    public String toString() {
        return "DecodeConfig{" +
                "characterSet='" + characterSet + '\'' +
                ", priority='" + priority + '\'' +
                '}';
    }


    public static final class Builder {

        private DecodeConfig mDecodeConfig;

        public Builder() {
            this.mDecodeConfig = new DecodeConfig();
        }

        public Builder setCharacterSet(String characterSet) {
            this.mDecodeConfig.characterSet = characterSet;
            return this;
        }

        public Builder setPriority(DecoderPriority priority) {
            this.mDecodeConfig.priority = priority;
            return this;
        }

        public DecodeConfig build() {
            return mDecodeConfig;
        }
    }
}
